//
//  TYZRouter.h
//  TYZKitExampDemo
//
//  Created by TangBin on 2019/2/20.
//  Copyright © 2019 TangBin. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

/**
 为了解耦，组件化
 路由中间件 要求动态调用的方法只能有一个参数
 */
@interface TYZRouter : NSObject

+ (instancetype)sharedInstance;

/**
  远程App调用入口
 scheme://[target]/[action]?[params]
 
 url sample:
 aaa://targetA/actionB?id=123

 @param url url description
 @param completion completion description
 @return return value description
 */
- (id _Nullable)performActionUrl:(NSURL *)url completion:(nullable void(^)(NSDictionary *info))completion;

/**
 本地u组件调用入口

 @param targetName targetName description
 @param actionName actionName description
 @param param param description
 @param shouldCacheTarget shouldCacheTarget description
 @return return value description
 */
- (id _Nullable)performTarget:(NSString *)targetName action:(NSString *)actionName params:(NSDictionary * _Nullable)param shouldCacheTarget:(BOOL)shouldCacheTarget;

/**
 清空具体的缓存

 @param targetName targetName description
 */
- (void)removeCachedTargetWithTargetName:(NSString *)targetName;


@end

NS_ASSUME_NONNULL_END


























